package com.fat.spzx.utils;

import com.fat.spzx.model.entity.system.SysUser;

public class AuthContextUtil {

    // 用于存储当前线程的用户信息
    private static final ThreadLocal<SysUser> threadLocal = new ThreadLocal<>();

    // 设置用户信息
    public static void setUser(SysUser sysUser){
        threadLocal.set(sysUser);
    }

    // 获取用户信息
    public static SysUser getUser(){
        return threadLocal.get();
    }

    // 移除用户信息
    public static void removeUser(){
        threadLocal.remove();
    }

}
